package com.jiutong.meipengdai.http.model.requests;

import com.jiutong.meipengdai.http.RetrofitHandle;
import com.jiutong.meipengdai.http.SubscribeHandler;
import com.jiutong.meipengdai.http.model.services.ImageUploadService;

import java.util.Map;

import rx.Observable;
import rx.Subscriber;

/**
 * Created by suxi on 2017/5/27.
 */

public class ImageUploadRequest extends SubscribeHandler{

    /**
     * 图片上传
     */
    public void imgUpload(Subscriber subscriber, Map<String, Object> fields) {

        fields.put("method", "upload.file");
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(ImageUploadService.class)
                .imgUpload(fields);

        toSubscribe(observable, subscriber);
    }

}
